<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link rel="stylesheet" type="text/css" href="https://tstatic.dgg.net/static/plugs/ztree/css/zTreeStyle/zTreeStyle.css"/>
<div class="body-main">
    <form action="" id="userChooseForm">
        <input type="hidden" class="radioOrCheck" />
        <input type="hidden" class="layerIndex" />
        <input type="hidden" name="type" value="${map.type}" />
        <input type="hidden" name="roleCode" value="${map.roleCode}" />
        <input type="hidden" name="locked" value="${map.locked}" />
        <div class="titleSearch">
            <div class="layui-inline">
                <label>部门：</label>
                    <div class="layui-input-inline">
                        <input type="text" class="input-style" id="organSelectTree" style="width: 200px" readonly>
                        <input type="hidden" class="input-style" name="organId">
                </div>
            </div>
            <div class="layui-inline">
                <label>工号：</label>
                <div class="layui-input-inline">
                    <input type="text" class="input-style" name="loginName">
                </div>
            </div>
            <div class="layui-inline">
                <label>姓名：</label>
                <div class="layui-input-inline">
                    <input type="text" class="input-style" name="realName">
                </div>
            </div>
            <div class="layui-inline">
                <button class="layui-btn layui-btn-mini layui-btn-normal" type="button" id="searchTable">搜索</button>
                <button class="layui-btn layui-btn-mini layui-btn-primary" type="reset">清空</button>
            </div>
        </div>
    </form>
    <table id="chooseUserTable" class="cell-border crm-table">
    </table>
</div>
<script src="https://tstatic.dgg.net/static/plugs/ztree/js/jquery.ztree.all.js"></script>
<script src="https://tstatic.dgg.net/static/plugs/ztree/js/jquery.ztree.select.js"></script>
<script>
    $('#organSelectTree').selectTree({
        url:sysInfo.basePath+'/zzsc/common/organ_tree_data.do',
        code:'name',//指定获取id的字段名
        close:true,
        idKey: "id",//指定id
        pIdKey: "parentId",//指定parentId
        otherParam:{
            type:$('#userChooseForm').find('[name="type"]').val()
        },
        changeFun: function(event, treeId, treeNode){
            $('[name="organId"]').val(treeNode.id);
        }
    });
</script>